
import 'package:baselib/base/base_service.dart';
import 'package:baselib/base/base_view_model.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:moduletwo/entity/user_entity.dart';

class GetTwoMainTabViewModel extends BaseViewModel{


  @override
  BaseService createService()=>null;

  TabController tabController;
  TickerProvider tickerProvider;
  List<Widget> tabs=[
    Text('A'),
    Text('B'),
    Text('C'),
  ];

  RxMap arguments={}.obs;
  var userEntity=UserEntity().obs;
  GetTwoMainTabViewModel({this.tickerProvider});
  @override
  void onInit() {
    // TODO: implement onInit
    //设置tab
    _initTabs();
    super.onInit();
  }

  @override
  void onReady() {
    // TODO: implement onReady
    arguments.value = Get.arguments;
    userEntity.value=arguments['userEntity'];
    print('arguments-->${arguments.toString()}');
    // update();
    super.onReady();
  }

  void _initTabs() {
    tabController=TabController(length:tabs.length,vsync: tickerProvider );
  }


}